{% extends 'base.html' %}
{% load static %}

{% block title %}
    小涛博客 - 我的消息
{% endblock %}

{% block header_extends %}{% endblock %}

{% block nav_home_active %}active{% endblock %}

{% block content %}
        <div class="container" style="margin-top: 80px;">
            <div class="row">
                <div class="col-md-1"></div>
                <div class="col-md-10">
                    <!-- content start -->
                    <div class="btn_news">
                        <a class="btn btn-primary" href="{% url 'notifications:mark_all_as_read' %}?next={% url 'my_notifications' %}">全部标记为已读</a>
                        <a class="btn btn-danger" href="{% url 'delete_my_read_notifications' %}">删除已读消息</a>
                    </div>
                    <ul class="notifications">
                        {% for notification in request.user.notifications.all %}
                            <li class="{% if not notification.unread %}read{% endif %}">
                                [{{ notification.timesince }}之前]
                                <a href="{% url 'my_notification' notification.pk %}">{{ notification.verb }}</a>
                            </li>
                        {% empty %}
                            <li>暂无消息</li>
                        {% endfor %}
                    </ul>
                    <!-- content end -->
                </div>
                <div class="col-md-1"></div>
            </div>
        </div>
{% endblock %}